package com.zhuss.controller.advice;

import com.zhuss.advice.proposal.ProposalReadServiceExt;
import com.zhuss.bean.bo.advice.proposal.DetailProposalBo;
import com.zhuss.bean.bo.advice.proposal.SearchProposalBo;
import com.zhuss.common.BaseController;
import com.zhuss.common.ReadService;
import com.zhuss.exception.WpsException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: zhushanshuo
 * @Date: 2020/3/6 9:40
 */
@RestController
@RequestMapping("/complaintSon")
public class ComplaintSonReadController extends BaseController {

    @Autowired
    @Qualifier("proposalReadService")
    private ReadService<Object, Object> proposalReadService;

    @Autowired
    @Qualifier("proposalReadServiceExt")
    private ProposalReadServiceExt proposalReadServiceExt;

    /**
     * 列表
     * @throws WpsException
     */
    @ResponseBody
    @RequestMapping("/list")
    public Object list(@RequestBody SearchProposalBo bo) throws WpsException {
        Object result = proposalReadService.list(bo);
        return result;
    }

    /**
     * 意见回复列表
     * @throws WpsException
     */
    @ResponseBody
    @RequestMapping("/replyList")
    public Object replyList(@RequestBody SearchProposalBo bo) throws WpsException {
        Object result = proposalReadServiceExt.replyList(bo);
        return result;
    }

    /**
     * 详情
     * @throws WpsException
     */
    @ResponseBody
    @RequestMapping("/detail")
    public Object detail(@RequestBody DetailProposalBo bo) throws WpsException {
        Object result = proposalReadService.detail(bo);
        return result;
    }
}
